<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>作业</title>
</head>
<body>
<!--点击哪个，就显示红色-->
<style>
  .mycolor {
    color: red;
  }

</style>

<div id="app">
  <ul>
    <li v-on:click="changeColor" :class="{mycolor: m}" v-for="(m, index) in movies">{{index}}-{{m}}</li>
  </ul>
</div>
<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      movies: ['海王', '海尔兄弟', '葫芦娃', '大头儿子小头爸爸', '西游记'],
      isActive: false
    },
    methods: {
      changeColor: function () {
          this.isActive = !this.isActive
      }
    }
  })
</script>
</body>
</html>
